package com.gupao.strategy.pay.payport;

import com.gupao.strategy.pay.MsgResult;

import java.util.HashMap;
import java.util.Map;

public class PayStrategy {
    private static final String ALI_PAY = "支付宝";
    private static final String WECHAT_PAY = "微信支付";

    private static Map<String, PayMent> payMentMap = new HashMap<String, PayMent>();

    static{
        payMentMap.put(ALI_PAY, new AliPay());
        payMentMap.put(WECHAT_PAY, new WeChatPay());
    }

    public static PayMent pay(String payKey){
        PayMent payMent = payMentMap.get(payKey);
        return payMent == null ? payMentMap.get(ALI_PAY) : payMent;
    }
}
